﻿using System;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace NTmdb.TestProject
{
    /// <summary>
    ///     This is a test class for DisoveryFilterTest and is intended
    ///     to contain all DisoveryFilterTest Unit Tests
    /// </summary>
    [TestClass]
    public class DisoveryFilterTest
    {
        /// <summary>
        ///     A test for DisoveryFilter Constructor
        /// </summary>
        [TestMethod]
        public void DisoveryFilterConstructorTest()
        {
            var target = new DisoveryFilter();
            Assert.IsNotNull( target );
        }

        /// <summary>
        ///     A test for CertificationCountry
        /// </summary>
        [TestMethod]
        public void CertificationCountryTest()
        {
            var target = new DisoveryFilter();
            string expected = Guid.NewGuid().ToString();
            string actual;
            target.CertificationCountry = expected;
            actual = target.CertificationCountry;
            Assert.AreEqual( expected, actual );
        }

        /// <summary>
        ///     A test for Companies
        /// </summary>
        [TestMethod]
        public void CompaniesTest()
        {
            var target = new DisoveryFilter();
            var expected = new List<int>();
            List<int> actual;
            target.Companies = expected;
            actual = target.Companies;
            Assert.AreSame( expected, actual );
        }

        /// <summary>
        ///     A test for GenreFilter
        /// </summary>
        [TestMethod]
        public void GenreFilterTest()
        {
            var target = new DisoveryFilter();
            var expected = new GenreFilter();
            GenreFilter actual;
            target.GenreFilter = expected;
            actual = target.GenreFilter;
            Assert.AreSame( expected, actual );
        }

        /// <summary>
        ///     A test for IncludeAdult
        /// </summary>
        [TestMethod]
        public void IncludeAdultTest()
        {
            var target = new DisoveryFilter();
            var expected = new Random().Next( 0, Int32.MaxValue ) % 2 == 0;
            bool? actual;
            target.IncludeAdult = expected;
            actual = target.IncludeAdult;
            Assert.AreEqual( expected, actual );
        }

        /// <summary>
        ///     A test for MaximumCertification
        /// </summary>
        [TestMethod]
        public void MaximumCertificationTest()
        {
            var target = new DisoveryFilter();
            string expected = Guid.NewGuid().ToString();
            string actual;
            target.MaximumCertification = expected;
            actual = target.MaximumCertification;
            Assert.AreEqual( expected, actual );
        }

        /// <summary>
        ///     A test for MaximumReleaseDate
        /// </summary>
        [TestMethod]
        public void MaximumReleaseDateTest()
        {
            var target = new DisoveryFilter();
            var expected = DateTime.Now;
            DateTime? actual;
            target.MaximumReleaseDate = expected;
            actual = target.MaximumReleaseDate;
            Assert.AreEqual( expected, actual );
        }

        /// <summary>
        ///     A test for MinimumAverageVotet
        /// </summary>
        [TestMethod]
        public void MinimumAverageVotetTest()
        {
            var target = new DisoveryFilter();
            var expected = new Random().Next( 0, Int32.MaxValue );
            double? actual;
            target.MinimumAverageVotet = expected;
            actual = target.MinimumAverageVotet;
            Assert.AreEqual( expected, actual );
        }

        /// <summary>
        ///     A test for MinimumReleaseDate
        /// </summary>
        [TestMethod]
        public void MinimumReleaseDateTest()
        {
            var target = new DisoveryFilter();
            var expected = DateTime.Now;
            DateTime? actual;
            target.MinimumReleaseDate = expected;
            actual = target.MinimumReleaseDate;
            Assert.AreEqual( expected, actual );
        }

        /// <summary>
        ///     A test for MinimumVoteCount
        /// </summary>
        [TestMethod]
        public void MinimumVoteCountTest()
        {
            var target = new DisoveryFilter();
            var expected = new Random().Next( 0, Int32.MaxValue );
            int? actual;
            target.MinimumVoteCount = expected;
            actual = target.MinimumVoteCount;
            Assert.AreEqual( expected, actual );
        }

        /// <summary>
        ///     A test for PrimaryReleaseYear
        /// </summary>
        [TestMethod]
        public void PrimaryReleaseYearTest()
        {
            var target = new DisoveryFilter();
            var expected = new Random().Next( 0, Int32.MaxValue );
            int? actual;
            target.PrimaryReleaseYear = expected;
            actual = target.PrimaryReleaseYear;
            Assert.AreEqual( expected, actual );
        }

        /// <summary>
        ///     A test for SortBy
        /// </summary>
        [TestMethod]
        public void SortByTest()
        {
            var target = new DisoveryFilter();
            var expected = TmdbDiscoverySortBy.PopularityDesc;
            TmdbDiscoverySortBy actual;
            target.SortBy = expected;
            actual = target.SortBy;
            Assert.AreEqual( expected, actual );
        }

        /// <summary>
        ///     A test for Year
        /// </summary>
        [TestMethod]
        public void YearTest()
        {
            var target = new DisoveryFilter();
            var expected = new Random().Next( 0, Int32.MaxValue );
            int? actual;
            target.Year = expected;
            actual = target.Year;
            Assert.AreEqual( expected, actual );
        }
    }
}